import os.path
from Cheetah.Template import Template
import getopt
import sys
print 'ARGV      :', sys.argv[1:]
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'd:q:', ['db=', 
                                                             'query=',
                                                             'version=',
                                                             ])
print 'OPTIONS   :', options


filename="torrentSpiderTemplate.tmpl"
print Template ( file = filename, searchList =options )